<?php

use yii\db\Migration;

/**
 * Handles the creation of table `link`.
 */
class m180402_082708_create_link_table extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->createTable('link', [
            'id' => $this->primaryKey(),
            'title' => $this->string()->notNull()->comment('平台名称'),
            'url' => $this->string()->notNull()->comment('官方网站'),
            'category' => $this->smallInteger()->comment('平台分类'),//
            'desc' => $this->text()->comment('平台介绍'),
            'province' => $this->integer()->notNull()->comment('省份'),
            'city' => $this->integer()->notNull()->comment('城市'),
            'contact' => $this->text()->notNull()->comment('联系方式'),
            'score' => $this->text()->notNull()->comment('有价值信息情况'),
            'number' => $this->integer()->notNull()->comment('资产包/项目数量'),
            'route' => $this->text()->notNull()->comment('资产包/项目路径'),
            'contact_before' => $this->string()->notNull()->comment('初对接人'),
            'contact_now' => $this->string()->notNull()->comment('现对接人'),
            'history' => $this->text()->notNull()->comment('交接记录'),
            'remark' => $this->text()->notNull()->comment('备注'),
            'comment' => $this->text()->notNull()->comment('评论'),
            'owner' => $this->integer()->notNull()->comment('创建人'),
            'created_at' => $this->dateTime()->comment('创建时间'),
            'updated_at' => $this->timestamp()->comment('更新日期'),

        ]);
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropTable('link');
    }
}
